﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Commander.Portal.Models;

namespace Commander.Portal.Controllers {
	[HandleError]
	public class DashboardController : Controller {
		public ActionResult Index() {
			ViewData["Message"] = "Welcome to the Dashboard!";
      DashboardModel model = new DashboardModel();
      model.Projects.Add(new ProjectModel{ Id=Guid.NewGuid(),
         ProjectName="wololo"});
      model.Projects.Add(new ProjectModel{ Id=Guid.NewGuid(),
         ProjectName="wololo2"});
      ViewData.Model = model;
      //need to perform actual stuff here
			return View();
		}

    public ActionResult Projects() {
      return View();
    }

    public ActionResult PerformanceHistory() {
      return View();
    }

    public ActionResult Project(Guid projectId) {
      //Perform real stuff here
      var proj=new ProjectModel{ Id=Guid.NewGuid(),
         ProjectName="wololo2"};
      proj.Binary = new ProjectFile { FileName = "bini" };
      proj.SourceFiles.Add(new ProjectFile{ FileName="wololo"});
      proj.SourceFiles.Add(new ProjectFile { FileName = "wololo2" });
      ViewData["src"] = new MultiSelectList(proj.SourceFiles.Select(e=> e.FileName));
      ViewData.Model = proj;
      return View();
    }


		public ActionResult About() {
			return View();
		}
	}
}
